<?php

namespace plugin\kb_blog\app\api\controller;

use support\Request;
use support\Response;
use plugin\kb_blog\app\model\Blogroll;

/**
 * 友情链接
 */
class BlogrollController
{
    /**
     * 查询
     *
     * @param Request $request
     * @return Response
     */
    public function search(Request $request): Response
    {
        $Blogroll = Blogroll::orderBy("weight", "desc")
            ->orderBy("updated_at", "desc")
            ->get();
        return json(["code" => 0, "msg" => "ok", "data" => $Blogroll]);
    }
}
